import dbus

class awnnotifier:

    def __init__(self):
        bus = dbus.SessionBus()
        obj = bus.get_object("com.google.code.Awn", "/com/google/code/Awn")
        self.awn = dbus.Interface(obj, "com.google.code.Awn")
        self.awn.UnsetInfoByName ("gNotifier")
        
    def newMessagesReceived(self, data = [], fullCount = 0):
        self.data = data
        self.awn.SetInfoByName ("gNotifier", '%i' % fullCount)
